
/**
 * store 工厂类
 */
Ext.define('JS.store.StoreFactory', {
	stores  : new Ext.util.MixedCollection(),//缓存store
	getStoreByName : function(storeName) {
		if(!this.stores.containsKey(storeName)) {
			var newStore = Ext.define('JS.store.' + storeName, {
				extend   : 'Ext.data.Store',
				//autoLoad : true,
				proxy    : {
					type   : 'ajax',
					url    : '../../info/deptinfo',//this.url,
					//api    : this.api,
					reader : {
						type  : 'json',
						root  : 'rows',
						totalProperty: 'totalProperty'
					},
					writer : {
						type  : 'json'
					}
				}
			});
			
			this.stores.add(storeName, newStore);
		}
		return storeName;
	}
});
//var storeFactory = Ext.create('JS.store.StoreFactory', {});
